<?php
error_reporting ( E_ALL );
require_once dirname ( __FILE__ ) . '/../includes/dao/CategoryDao.php';
require_once dirname ( __FILE__ ) . '/../includes/Generic.php';

$o = new CategoryDao ();
$d = new Generic ();
$d->field = array (
		'id' => 1,
		'name' => "Pak Gendut 2",
		'level' => 1,
		'description' => "2Pecel Lele Lamongan pak gendut",
		'status' => "2" 
);
$result = $o->create ( $d );
if ($result == ENTITY_CREATE_FAILED) {
	echo $d->error_message;
}

echo "<br>";
$get = $o->get ( 1 );
print_r ( $get );

echo "<br>";
$find = $o->find ( null );
print_r ( $find );

echo '<br>';
$delete = $o->delete ( 2 );
print_r ( $delete );
?>